package com.ht.medicaltreatment.adapter

import android.widget.TextView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.ht.medicaltreatment.R
import com.ht.medicaltreatment.bean.OrderList96Bean

class OrderList96Adapter:BaseQuickAdapter<OrderList96Bean,BaseViewHolder>(R.layout.item_96_list_layout) {
    override fun convert(holder: BaseViewHolder, item: OrderList96Bean) {
        holder.setText(R.id.tvCode,"${getItemPosition(item)+1}")
        holder.setText(R.id.tvOrderName,item.name)
        holder.setText(R.id.tvProjectName,item.project.name)
        val status = holder.getView<TextView>(R.id.tvStatus)
        //0为未核验,1为已核验,2删除,3为核验中
        if(item.status == 0){
            status.setTextColor(context.getColor(R.color.red))
            status.text = "未核验"
        }else if(item.status == 1){
            status.setTextColor(context.getColor(R.color.green))
            status.text = "已核验"
        }else if(item.status == 3){
            status.text = "核验中"
            status.setTextColor(context.getColor(R.color.yellow))
        }
    }

}
